<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  class Cache {
    static data = {}

    static set(name, value) {
      return (this.data[name] = value)
    }

    static get(name) {
      return this.data[name]
    }
  }

  Cache.set("hdcms", "houdunren.com")
  console.log(Cache.get("hdcms"))

  let user = {
    name: 'apple',
    key: Symbol("资料"),
    desc: '用户资料'
  }
  let cart = {
    name: 'apple',
    key: Symbol("购物车"),
    desc: "购物车"
  }
  Cache.set(user.key, user)
  Cache.set(cart.key, cart)
  console.log(Cache.get(cart.key))
</script>
</body>
</html>